class A{
    isDisposed: boolean;
    dispose(){
        this.isDisposed=true
    }
}

class B{
    isActive:boolean;
    active(){
        this.isActive=true;
    }
    deactivate() {
        this.isActive=false;
    }
}

class C implements A,B{
    constructor(){
        setTimeout(()=>{console.log(this.isDisposed+":"+this.isActive)},500)
    };
    interact(){
        this.active()
    }
    isDisposed:boolean=false;
    dispose:()=>void;
    isActive:boolean=false;
    active:()=>void;
    deactivate:()=>void;
}

applyMixins(C, [A, B]);


function applyMixins(derivedCtor:any,baseCtors:any[]){
    baseCtors.forEach(baseCtor=>{
        Object.getOwnPropertyNames(baseCtor.prototype).forEach(name=>{
            derivedCtor.prototype[name]=baseCtor.prototype[name]
        })
    })
}

